package com.newsmanagement.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 零售商产品批号信息表
 * @TableName reta_batch
 */
@TableName(value ="reta_batch")
@Data
public class RetaBatch {
    /**
     * 编号（代替batch_id与reta_id的复合主键）
     */
    @TableId(type = IdType.AUTO)
    private Integer rbId;

    /**
     * 所属零售商产品批号
     */
    private String batchId;

    /**
     * 所属零售商编号
     */
    private Integer retaId;

    /**
     * 所属批发商场编号
     */
    private Integer wbId;

    /**
     * 产品品种
     */
    private String type;

    /**
     * 批号录入日期
     */
    private Date batchDate;

    /**
     * 溯源标识码
     */
    private String sourceId;

    /**
     * 溯源二维码
     */
    private String sourceQr;

    /**
     * 批号状态：1：新建；2：待确认；3：已确认；4：已下架；
     */
    private Integer state;

    /**
     * 备注
     */
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RetaBatch other = (RetaBatch) that;
        return (this.getRbId() == null ? other.getRbId() == null : this.getRbId().equals(other.getRbId()))
            && (this.getBatchId() == null ? other.getBatchId() == null : this.getBatchId().equals(other.getBatchId()))
            && (this.getRetaId() == null ? other.getRetaId() == null : this.getRetaId().equals(other.getRetaId()))
            && (this.getWbId() == null ? other.getWbId() == null : this.getWbId().equals(other.getWbId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getBatchDate() == null ? other.getBatchDate() == null : this.getBatchDate().equals(other.getBatchDate()))
            && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId()))
            && (this.getSourceQr() == null ? other.getSourceQr() == null : this.getSourceQr().equals(other.getSourceQr()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRbId() == null) ? 0 : getRbId().hashCode());
        result = prime * result + ((getBatchId() == null) ? 0 : getBatchId().hashCode());
        result = prime * result + ((getRetaId() == null) ? 0 : getRetaId().hashCode());
        result = prime * result + ((getWbId() == null) ? 0 : getWbId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getBatchDate() == null) ? 0 : getBatchDate().hashCode());
        result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode());
        result = prime * result + ((getSourceQr() == null) ? 0 : getSourceQr().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", rbId=").append(rbId);
        sb.append(", batchId=").append(batchId);
        sb.append(", retaId=").append(retaId);
        sb.append(", wbId=").append(wbId);
        sb.append(", type=").append(type);
        sb.append(", batchDate=").append(batchDate);
        sb.append(", sourceId=").append(sourceId);
        sb.append(", sourceQr=").append(sourceQr);
        sb.append(", state=").append(state);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}